<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html>
<head>
	<title>广告管理</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<%@ include file="/comm.jsp"%>
<style type="text/css">
<!--
fieldset {
    padding:10px;
    margin:10px;
    width:270px;
    color:#333; 
} 
legend {
    color:#06c;
    font-weight:800; 
} 
	-->
</style>

	<body>
	<s:form name ="formpage" action="adv_manage" namespace="/">
		<div>
  		<%@ include file="/messages.jsp"%>
			<fieldset>
				<legend>
					查询条件
				</legend>
				<table align="left" width="700" border="0">
					<tr>
						<td align="right">
							广告名称：</td>
						<td width="220px">
							<input id="advName" name="advDto.advName" 
						 		value="${advDto.advName }"
						 		size="30" type="text" maxlength="30"/> 
						</td>
						<td align="right">
							状态：</td>
						<td>
							<s:select list="#{'':'全部','0':'未发布','1':'已发布','2':'已删除'}"	 
							 name="advDto.status"
					  		 value="#request.advDto.status" 
					  		 id="status"
					  		 cssStyle="width:100px" >
							</s:select>
						</td>
						<td>
							<input type="submit" class="button" id="ok" name="ok" value=" 查 询 " />
							&nbsp;&nbsp;
							<s:submit action="adv_editPage" value=" 新 增 "></s:submit>
						</td>
					</tr>
				</table>
			</fieldset>
			</div>
            <table border="0" cellpadding="5" cellspacing="1" class="tb_datalist">
			 <tr align="center" height="28px" class="tr_title">
				<td>
					<b>名称</b>
				</td>
				<td>
					<b>广告标题</b>
				</td>
				<td>
					<b>语言</b>
				</td>
				<td>
					<b>序号</b>
				</td>
				<td>
					<b>有效期</b>
				</td>
				<td>
					<b>状态</b>
				</td>
				<td>
					<b>创建日期</b>
				</td>
				<td>
					<b>创建人</b>
				</td>			
				<td>
					<b>操作</b>
				</td>
			</tr>
			
			<s:iterator id="sa" value="#request.list">
				<tr class="list_tr_item"
						onMouseOver="javascript:this.className='tr_selected';"
						onMouseOut="javascript:this.className='tr_even';">
					<td align="center">
						<s:property value="#sa.advName" />
					</td>
					<td align="center">
						<a href="<s:url action="adv_view"><s:param name="id"><s:property value="#sa.id"/></s:param></s:url>">
							<s:property value="#sa.title" />
						</a>
					</td>
					<td>
						<s:if test='"zh_CN"==#sa.lang'>
							中文
						</s:if>
						<s:elseif test='"en"==#sa.lang'>
							英文
						</s:elseif>
					</td>
					<td>
						<s:property value="#sa.orderNum" />
					</td>
					<td align="center">
						<s:date name="#sa.startDate" format="yyyy-MM-dd"/>	
						至
						<s:date name="#sa.endDate" format="yyyy-MM-dd"/>	
					</td>
					<td align="center">
						<s:if test="0==#sa.status">
							未发布
						</s:if>
						<s:elseif test="1==#sa.status">
							已发布
						</s:elseif>
						<s:elseif test="2==#sa.status">
							已删除
						</s:elseif>
					</td>
					<td align="center">
						<s:date name="#sa.createDate" format="yyyy-MM-dd HH:mm"/>
					</td>
					<td>
						<s:property value="#sa.createUserid" />
					</td>
					
					<td align="center">
						<s:if test="0==#sa.status">
							<a href="<s:url action="adv_view"><s:param name="id"><s:property value="#sa.id"/></s:param></s:url>">
								发布
							</a>
						</s:if>
												
						<s:if test="2 != #sa.status">
						<a href="<s:url action="adv_delete"><s:param name="id"><s:property value="#sa.id"/></s:param></s:url>">
							删除
						</a>
						</s:if>
					</td>	
				</tr>
			</s:iterator>
		</table>
		<s:property value="#request.allowpage" escape="false" />
		</s:form>
	</body>
</html>
